/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sisvoto.modelo;

import java.io.Serializable;

import java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;

/**
 *
 * @author Dianita
 */
@Entity
public class Anio_Paralelo implements Serializable{
    
    @Id
    @GeneratedValue(strategy= GenerationType.AUTO)
    private Integer id;
    
    @ManyToOne 
    private AnioLectivo anio;
    
    @ManyToOne
    private Paralelo paralelo;
    
    @OneToMany(mappedBy="anioparalelo")
    private List<Elector> electores = new ArrayList<>();

    public AnioLectivo getAnio() {
        return anio;
    }

    public void setAnio(AnioLectivo anio) {
        this.anio = anio;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Paralelo getParalelo() {
        return paralelo;
    }

    public void setParalelo(Paralelo paralelo) {
        this.paralelo = paralelo;
    }

    public List<Elector> getElectores() {
        return electores;
    }

    public void setElectores(List<Elector> electores) {
        this.electores = electores;
    }

    public String toString() {
        return this.anio.getNombre() +"  -  "+ this.paralelo.getNombre();
    }

    
    
}
